
#include <bits/stdc++.h>

using namespace std;
int n,m;

void slove()
{
	cin >> n >> m;
	int maxV = max(n,m);
	while(maxV > 0)
	{
		if(n % maxV == 0 and m % maxV == 0)
		{
			cout << " ans = " << maxV;
			return;
 		}
 		--maxV;
	}
}
int main() {
	int T = 1;
	//cin >> T;
	while(T--)slove();



	return 0;
}

